﻿
Imports std

Public Class internalFunctionCall
    Inherits nocontentProcessor

    Public Class functionQuery
        Public Const clearStoroomCache As String = "clearStoroomCache"
    End Class

    Public Const _pathidentity As String = network.pathSeperator + "intfunc"

    Public Overrides Function pathidentity() As String
        Return _pathidentity
    End Function

    Protected Overrides Function processImpl(ByVal context As httpContext) As Boolean
        If Not context.isinternalRequest() Then
            raiseError("receive internalFunctionCall as not isinternalRequest, ignore.")
            Return True
        End If
        Dim it As map(Of String, String).iterator = Nothing
        it = context.url().query.begin()
        While it <> context.url().query.end()
            If strsame((+it).first(), functionQuery.clearStoroomCache, False) Then
                raiseError("internalFunctionCall clearStoroomCache.")
                storoomc.storehelper.clearCache()
            End If
            it += 1
        End While
        Return True
    End Function
End Class